package com.kaifamiao.month05.day10.test;

import java.net.Socket;
import java.util.UUID;

public class Client2 {

    public static void main(String[] args) throws Exception {
        Socket socket = new Socket("localhost", 9999);
        System.out.println("客户端2启动！");
//		Scanner in = new Scanner(System.in);
//		String str = in.nextLine();
        String mess = UUID.randomUUID().toString();
        socket.getOutputStream().write(mess.getBytes());
        socket.shutdownOutput();
        System.out.println("服务器返回的内容：" + new String(socket.getInputStream().readAllBytes()));
    }
}
